package mspbots.cw.client.core.data.callbacks;

import lombok.Builder;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * com.mspbots.sync.callback.Callback
 *
 * @author Alex bob(https://github.com/vnobo)
 * @date Created by 2019/9/23
 */
@Data
@Builder
public class CallbackParam {

    private Long id;

    private String url;

    @NotNull(message = "[objectId] not null.")
    private Integer objectId;

    @NotBlank(message = "[type] not null.")
    private String type;

    @NotBlank(message = "[level] not empty.")
    private String level;

    public static CallbackParam withType(String type) {
        return CallbackParam.builder().type(type)
                .level("owner").objectId(1).build();
    }

    public CallbackParam setUrl(String url) {
        this.url = url;
        return this;
    }


}
